package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.GoodsComment;
import com.micro.modual.model.bo.goodscomment.GoodsCommentBO;

/**
 * <h1>商品评论表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class GoodsCommentExtension {

    /**
     * <h2>转换: 商品评论表 新增</h2>
     *
     * @param goodsCommentBO {@link GoodsCommentBO} 商品评论表 新增/修改 请求对象
     * @return {@link GoodsComment} 商品评论表
     */
    public static GoodsComment converAddGoodsComment(GoodsCommentBO goodsCommentBO) {
        GoodsComment goodsComment = new GoodsComment();
        goodsComment.setId(SnowFlakeUtil.getId());
        goodsComment.setCommentContent(goodsCommentBO.getCommentContent());
        goodsComment.setUserCode(goodsCommentBO.getUserCode());
        goodsComment.setHasPicture(goodsCommentBO.getHasPicture());
        goodsComment.setPicUrls(goodsCommentBO.getPicUrls());
        goodsComment.setCommentScore(goodsCommentBO.getCommentScore());
        goodsComment.setCommentType(goodsCommentBO.getCommentType());
        goodsComment.setCreateTime(goodsCommentBO.getCreateTime());
        goodsComment.setReplyTime(goodsCommentBO.getReplyTime());
        goodsComment.setMerchantReply(goodsCommentBO.getMerchantReply());
        return goodsComment;
    }

    /**
     * <h2>转换: 商品评论表 修改</h2>
     *
     * @param goodsCommentBO {@link GoodsCommentBO} 商品评论表 新增/修改 请求对象
     * @return {@link GoodsComment} 商品评论表
     */
    public static GoodsComment converEditGoodsComment(GoodsCommentBO goodsCommentBO) {
        GoodsComment goodsComment = new GoodsComment();
        goodsComment.setId(goodsCommentBO.getId());
        goodsComment.setCommentContent(goodsCommentBO.getCommentContent());
        goodsComment.setUserCode(goodsCommentBO.getUserCode());
        goodsComment.setHasPicture(goodsCommentBO.getHasPicture());
        goodsComment.setPicUrls(goodsCommentBO.getPicUrls());
        goodsComment.setCommentScore(goodsCommentBO.getCommentScore());
        goodsComment.setCommentType(goodsCommentBO.getCommentType());
        goodsComment.setCreateTime(goodsCommentBO.getCreateTime());
        goodsComment.setReplyTime(goodsCommentBO.getReplyTime());
        goodsComment.setMerchantReply(goodsCommentBO.getMerchantReply());
        return goodsComment;
    }
}
